﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BF.Model;
using BF.Infrastructure;
using System.Linq.Expressions;

namespace BF.IBLL.BaseSystem.AreaManagement
{
    public interface Isys_AreaBLL
    {
        /// <summary>
        /// 根据编码和级别，截取编码
        /// </summary>
        /// <param name="areaCode"></param>
        /// <param name="areaLevel"></param>
        /// <returns></returns>
        string GetSubAreaCode(string areaCode, out int areaLevel);

        /// <summary>
        /// 获取编码的当前级别
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        int GetLevelByAreaCode(string areaCode);
        /// <summary>
        /// 根据主键sID获取实体
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        sys_Area GetModelByID(string areaCode);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool Add(sys_Area model);
        /// <summary>
        /// 更新
        /// </summary>
        /// <returns></returns>
        bool Update();
        /// <summary>
        /// 获取分页的数据集
        /// </summary>
        /// <param name="where"></param>
        /// <param name="orderBy"></param>
        /// <param name="pageModel"></param>
        /// <param name="isAscending"></param>
        /// <returns></returns>
        List<sys_Area> GetList(Expression<Func<sys_Area, bool>> where, Expression<Func<sys_Area, object>> orderBy, PageModel pageModel, bool isAscending);
        /// <summary>
        /// 获取数据集
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <returns>查询结果</returns>
        List<sys_Area> GetList(Expression<Func<sys_Area, bool>> where);
        /// <summary>
        /// 获取分页总数
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        int GetRowCount(Expression<Func<sys_Area, bool>> where);

    }
}
